projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c444972
)
* fns.c (concat): Catch string overflow earlier.
author
Paul Eggert
<eggert@cs.ucla.edu>
Sat, 18 Jun 2011 15:08:31 +0000
(08:08 -0700)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Sat, 18 Jun 2011 15:08:31 +0000
(08:08 -0700)
Do not rely on integer wraparound.
src/ChangeLog
patch
|
blob
|
history
src/fns.c
patch
|
blob
|
history
diff --git
a/src/ChangeLog
b/src/ChangeLog
index 5493a0fc2207312b4124b2cf5169020a9ee6c680..e01e7ed7eceb68849e987c6ced16031ada59ac34 100644
(file)
--- a/
src/ChangeLog
+++ b/
src/ChangeLog
@@
-1,5
+1,8
@@
2011-06-18 Paul Eggert <eggert@cs.ucla.edu>
+ * fns.c (concat): Catch string overflow earlier.
+ Do not rely on integer wraparound.
+
* dispextern.h (struct it.overlay_strings_charpos): EMACS_INT, not int.
2011-06-17 Paul Eggert <eggert@cs.ucla.edu>
diff --git
a/src/fns.c
b/src/fns.c
index a19c886e3e1f0ef002db37d7337e6c8c748fcf68..4c1505ab0f12b94cad973b80778d8a56c88fa8bc 100644
(file)
--- a/
src/fns.c
+++ b/
src/fns.c
@@
-565,8
+565,8
@@
concat (ptrdiff_t nargs, Lisp_Object *args,
}
result_len += len;
- if (
result_len < 0
)
-
error ("String overflow"
);
+ if (
STRING_BYTES_BOUND < result_len
)
+
string_overflow (
);
}
if (! some_multibyte)